//
//  InputViewController.m
//  收纳
//
//  Created by  on 2022/10/28.
//

#import "InputViewController.h"

@interface InputViewController ()
@property (strong, nonatomic) IBOutlet UILabel *titlelbl;
@property (strong, nonatomic) IBOutlet UITextField *input;
@property (strong, nonatomic) IBOutlet UIButton *enterBtn;
@property (strong, nonatomic) IBOutlet UIButton *cancel;
@property (nonatomic,copy) void(^block)(NSString *string);
@end

@implementation InputViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)actionForBtn:(UIButton *)sender {
    if (self.block && sender.tag == 201) {
        if (self.input.text.length <= 0) {
            return [CCHud msg:LS(@"内容不能为空")];
        }
        self.block(self.input.text);
    }
    [self dismissViewControllerAnimated:NO completion:nil];
}
+(void)show:(void(^)(NSString *string))block{
   InputViewController *vc = [InputViewController new];
    vc.block = block;
    [[self currentVC] presentViewController:vc animated:NO completion:nil];
}

@end
